// 全局样式文件
import './assets/main.scss'
// 引入重置样式表 第三方的样式表
import 'normalize.css';

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

import 'element-plus/dist/index.css'
const app = createApp(App)

// element-ui的国际化
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
app.use(ElementPlus, {
  locale: zhCn,
})

// pinia 的持久化
import { createPersistedState } from 'pinia-persistedstate-plugin' //+++++++++++
const pinia = createPinia();
pinia.use(createPersistedState())// +++++++++
app.use(pinia)

// 定义全局自定义指令
import { useUserStore } from '@/stores/userstore'
const userstore = useUserStore();
app.directive('permission', (el, binding) => {
  if (userstore.role == 2) {

  } else {
    el.remove()
  }
})



app.use(router)

app.mount('#app')
